#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N=2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//
int a[N],n,b[N],c[N];
void solve()
{
	cin>>n;
	for(int i=0;i<n;i++) {cin>>a[i];b[i]=a[i],c[i]=a[i];}

	a[0]++;
	bool ok=true;
	for(int i=1;i<n;i++)
	{
		if(a[i]==a[i-1])
		{
			a[i]++;continue;
		}
		if(a[i]==a[i-1]+1) 
		{
			continue;
		}
		if(a[i]==a[i-1]+2)
		{
			a[i]--;continue;
		}
		ok=false;break;
	}

	b[0]--;
	bool ok1=true;
	for(int i=1;i<n;i++)
	{
		if(b[i]==b[i-1])
		{
			b[i]++;continue;
		}
		if(b[i]==b[i-1]+1) 
		{
			continue;
		}
		if(b[i]==b[i-1]+2)
		{
			b[i]--;continue;
		}
		ok1=false;break;
	}

	bool ok2=true;
	for(int i=1;i<n;i++)
	{
		if(c[i]==c[i-1])
		{
			c[i]++;continue;
		}
		if(c[i]==c[i-1]+1) 
		{
			continue;
		}
		if(c[i]==c[i-1]+2)
		{
			c[i]--;continue;
		}
		ok2=false;break;
	}

	if(ok||ok1||ok2) cout<<"YES"<<'\n';
	else cout<<"NO"<<'\n';

}

int main()
{
	close();
	int T; cin>>T;
	while (T--) solve();
	return 0;
}
//递增变成连续递增 1 2 3,连续递增